home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir36
/
tsbat46.zip
/
VIRUS.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-09-19
|
3KB
|
84 lines
@echo off
echo.
echo ┌───────────────────────────────────────────────────┐
echo │ Virus testbench based on directory comparisons │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sat 19-Sep-1992 │
echo └───────────────────────────────────────────────────┘
if "%1"=="" goto _help
rem Do some housekeeping
if exist diffe.$$$ del diffe.$$$
rem Make an ex-ante directory for comparison. Add more directories
rem and files as you deem fit
dir *.* > tmp.$$$
if exist *.exe dir *.exe >> tmp.$$$
if exist *.com dir *.com >> tmp.$$$
type tmp.$$$ | find /v "bytes" | find /v "TMP $$$" > before.$$$
if exist tmp.$$$ del tmp.$$$
rem Run the suspect program (at your own risk!)
set program_=
:_loop
set program_=%program_% %1
shift
if not "%1"=="" goto _loop
call %program_%
rem Make an ex-post directory for the comparison
dir *.* > tmp.$$$
if exist *.exe dir *.exe >> tmp.$$$
if exist *.com dir *.com >> tmp.$$$
type tmp.$$$ | find /v "bytes" | find /v "BEFORE $$$" | find /v "TMP $$$" > after.$$$
if exist tmp.$$$ del tmp.$$$
rem Check for changes using the external MsDos fc.exe file compare and
rem MsDos find.exe text search utilities
fc after.$$$ before.$$$ > tmp.$$$
type tmp.$$$ | find "no differences encountered" > same.$$$
del tmp.$$$
if exist nodiffe.$$$ del nodiffe.$$$
copy same.$$$ nodiffe.$$$ > nul
if exist same.$$$ del same.$$$
if not exist nodiffe.$$$ goto _differ
rem No changes have occurred
echo ┌─────────────────────────────────────────────────────────┐
echo │ The scanned directories and files have not been changed │
echo └─────────────────────────────────────────────────────────┘
goto _out
:_differ
fc before.$$$ after.$$$ > diffe.$$$
echo ┌────────────────────────────────────────────────────────────────┐
echo │ Warning: The scanned directories and files have been changed │
echo │ See diffe.$$$ for details │
echo └────────────────────────────────────────────────────────────────┘
goto _out
:_help
echo.
echo Usage: VIRUS SuspectProgram [parameter1] [parameter2] [...]
echo.
echo This batch makes a directory both prior and after running the
echo suspect program, and gives a warning if the directories differ,
echo and prepares a list of the differences.
echo.
echo This batch can be also used by a knowledgeable user for the more
echo benevolent similar purpose of checking what files a certain programs
echo changes.
echo.
echo If you get an "Out of environment space" message, increase your
echo environment space by using shell configuration in config.sys:
echo MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
goto _out2
:_out
if exist nodiffe.$$$ del nodiffe.$$$
if exist before.$$$ del before.$$$
if exist after.$$$ del after.$$$
:_out2
set program_=
echo on